const express = require("express")
const app = express()

app.set('secret','fsffgfgcv')

app.use(express.json())  //json
app.use(require('cors')()) // 跨域
app.use('/uploads',express.static(__dirname + '/uploads'))//托管静态文件 全局访问 /uploads访问静态文件


require('./plugins/db')(app)//数据库
require('./routes/admin')(app)//admin路由


app.listen(3001, () => {
  console.log('http://localhost:3001') 
})